package logic

import (
	"B/shenzhou_srv/model/mysql"
	"context"

	"B/shenzhou_srv/internal/svc"
	"B/shenzhou_srv/shenzhou"

	"github.com/zeromicro/go-zero/core/logx"
)

type GoodsStatusLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewGoodsStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsStatusLogic {
	return &GoodsStatusLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *GoodsStatusLogic) GoodsStatus(in *shenzhou.GoodsStatusRequest) (*shenzhou.GoodsStatusResponse, error) {
	// todo: add your logic here and delete this line
	var g mysql.Goods
	err := g.GoodsStatus(int(in.GoodsId), in.Status)
	if err != nil {
		return nil, err
	}
	return &shenzhou.GoodsStatusResponse{Success: true}, nil
}
